package org.ediba.siri.core.model.service;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.ediba.siri.core.Filter;
import org.ediba.siri.core.model.domain.Model;
import org.ediba.siri.core.model.domain.ModelAddress;
import org.ediba.siri.core.model.domain.ModelEmail;
import org.ediba.siri.core.model.domain.ModelFeature;
import org.ediba.siri.core.model.domain.ModelModel;
import org.ediba.siri.core.model.domain.ModelModelId;
import org.ediba.siri.core.model.domain.ModelNote;
import org.ediba.siri.core.model.domain.ModelPhone;
import org.ediba.siri.core.model.domain.ModelRelationship;
import org.ediba.siri.core.model.domain.ModelSchool;
import org.ediba.siri.core.model.domain.ModelVisit;

public interface ModelService {

	/****************MODELS********************/
	abstract Model create();
	abstract Model retrieve(int id);
	abstract Model update(Model model);
	abstract boolean delete(int id);
	
	abstract List<Model> retrieve(String[] name, int start, int limit);
	abstract List<Model> retrieve(Map<Filter,Object> filters, String sort, boolean dir, int start, int limit);
	abstract List<Model> retrieve(Map<Filter, Object> filters, String sort, boolean dir);
	abstract int retrieveCount(Map<Filter,Object> filters);
	abstract int retrieveCount();
	
	/****************MODELS-MODELS********************/
	abstract ModelModel modelModelCreate(int idModelA, int idModelB, Model modelByIdModelB, Model modelByIdModelA, ModelRelationship modelrelationship);
	abstract ModelModel modelModelRetrieve(ModelModelId id);
	abstract ModelModel modelModelUpdate(ModelModel modelModel);
	abstract boolean modelModelDelete(ModelModelId id);
	
	abstract List<ModelModel> modelModelRetrieve();
	abstract List<ModelModel> modelModelretrieveForIdModelB(int idModelB);
	/****************MODELS-RELATIONSHIPS********************/
	abstract ModelRelationship relationshipCreate(String name, boolean message);
	abstract ModelRelationship relationshipRetrieve(int id);
	abstract ModelRelationship relationshipUpdate(ModelRelationship modelRelationship);
	abstract boolean relationshipDelete(int id);
	
	abstract List<ModelRelationship> relationshipRetrieve();
	abstract List<ModelRelationship> relationshipRetrieve(String sort,boolean dir,int start, int limit);
	/****************MODELS-ADDRESS********************/
	abstract ModelAddress addressCreate(String street, Integer number, int idModel);
	abstract ModelAddress addressRetrieve(int id);
	abstract ModelAddress addressUpdate(ModelAddress modelAddress);
	abstract boolean addressDelete(int id);
	/****************MODELS-PHONE********************/
	abstract ModelPhone phoneCreate(String number, int idModel);
	abstract ModelPhone phoneRetrieve(int id);
	abstract ModelPhone phoneUpdate(ModelPhone modelPhone);
	abstract boolean phoneDelete(int id);
	/****************MODELS-EMAIL********************/
	abstract ModelEmail emailCreate(String email, int idModel);
	abstract ModelEmail emailRetrieve(int id);
	abstract List<ModelEmail> emailRetrieve();
	abstract ModelEmail emailUpdate(ModelEmail modelEmail);
	abstract boolean emailDelete(int id);
	/****************MODELS-FEATURES********************/
	abstract ModelFeature featureCreate(String feature, int idModel);
	abstract ModelFeature featureRetrieve(int id);
	abstract ModelFeature featureUpdate(ModelFeature modelFeature);
	abstract boolean featureDelete(int id);
	/****************MODELS-NOTES********************/
	abstract ModelNote noteCreate(String text, int idModel);
	abstract ModelNote noteRetrieve(int id);
	abstract ModelNote noteUpdate(ModelNote modelNote);
	abstract boolean noteDelete(int id);
	/****************MODELSCHOOL********************/
	abstract ModelSchool modelSchoolCreate(String name);
	abstract List<ModelSchool> modelSchoolRetrieve();
	abstract ModelSchool modelSchoolRetrieve(int id);
	abstract List<ModelSchool> modelSchoolRetrieve(Map<Filter,Collection<Object>> filters, String sort, boolean dir);
	abstract ModelSchool modelSchoolUpdate(ModelSchool modelSchool);
	abstract boolean modelSchoolDelete(int id);
	/****************MODELSVISIT********************/
	abstract ModelVisit visitCreate(int idModel,int idRequest,Date date,boolean delivered);
	abstract ModelVisit visitRetrieve(int id);
	abstract ModelVisit visitUpdate(ModelVisit modelVisit);
	abstract boolean visitDelete(int id);
}
